]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell-window-tracker: Detect invalid PID values of 0
authorJonas Dreßler <verdre@v0yd.nl>
Mon, 6 Apr 2020 18:28:00 +0000 (20:28 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 6 Apr 2020 21:53:37 +0000 (21:53 +0000)
MetaWindows get_pid() API changed to use the client PID, which also
works for Wayland clients instead of only X11 clients now. This API
returns 0 instead of -1 for invalid PIDs, so update our check according
to that.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1184

src/shell-window-tracker.c

index 075cb2a1649a021f669057b5298f8db13c28b04d..99ed8270c0efad35c54e731a6fc362d7b8201a4b 100644 (file)
@@ -343,7 +343,7 @@ get_app_from_window_pid (ShellWindowTracker  *tracker,
 
   pid = meta_window_get_pid (window);
 
-  if (pid == -1)
+  if (pid < 1)
     return NULL;
 
   result = shell_window_tracker_get_app_from_pid (tracker, pid);